import java.io.*;

public class T0603 {
    public static void main(String[] args) throws Exception {
        BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("a.txt"));

        String s="hello java";
        bos.write(s.getBytes());
        bos.close();



        BufferedInputStream bis=new BufferedInputStream(new FileInputStream("a.txt"));
        byte[]bys=new byte[1024];
        int len=0;
        while((len=bis.read(bys))!=-1){
            System.out.println(new String(bys,0,len));
        }
        bis.close();
    }
}
